# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PubSubLite.V1.Model.SeekSubscriptionRequest do
  @moduledoc """
  Request for SeekSubscription.

  ## Attributes

  *   `namedTarget` (*type:* `String.t`, *default:* `nil`) - Seek to a named position with respect to the message backlog.
  *   `timeTarget` (*type:* `GoogleApi.PubSubLite.V1.Model.TimeTarget.t`, *default:* `nil`) - Seek to the first message whose publish or event time is greater than or equal to the specified query time. If no such message can be located, will seek to the end of the message backlog.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :namedTarget => String.t() | nil,
          :timeTarget => GoogleApi.PubSubLite.V1.Model.TimeTarget.t() | nil
        }

  field(:namedTarget)
  field(:timeTarget, as: GoogleApi.PubSubLite.V1.Model.TimeTarget)
end

defimpl Poison.Decoder, for: GoogleApi.PubSubLite.V1.Model.SeekSubscriptionRequest do
  def decode(value, options) do
    GoogleApi.PubSubLite.V1.Model.SeekSubscriptionRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PubSubLite.V1.Model.SeekSubscriptionRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
